// WS2812B_RMT.h
#ifndef WS2812B_RMT_H
#define WS2812B_RMT_H

#include <Arduino.h>
#include <driver/rmt.h>

class WS2812B_RMT {
private:
    rmt_channel_t channel;
    uint16_t numLeds;
    uint8_t *pixels;
    uint8_t brightness;
    
public:
    WS2812B_RMT(uint16_t n, uint8_t pin, rmt_channel_t rmtChannel = RMT_CHANNEL_0);
    ~WS2812B_RMT();
    
    void setPixelColor(uint16_t n, uint8_t r, uint8_t g, uint8_t b);
    void setPixelColor(uint16_t n, uint32_t color);
    void setBrightness(uint8_t b);
    void show();
    void clear();
    uint16_t numPixels() const;
    uint32_t Color(uint8_t r, uint8_t g, uint8_t b);

    void setBrightBlue();  // 设置为亮蓝色
    void setBrightGreen();  // 设置为亮蓝色
    void turnOff();       // 全部熄灭
};



void WS2812B_Toggle();



#endif